package com.hellobike.haxing.modules.wms.facade;

import com.hellobike.haxing.modules.wms.dto.StockChangeDto;
import com.hellobike.haxing.modules.wms.exception.WmsServiceException;

import java.math.BigDecimal;

public interface WmsStockFacade {

    /**
     * 主库存增加
     * @param stockChangeDto
     * @return
     * @throws WmsServiceException
     */
    StockChangeDto  addMainStock(StockChangeDto stockChangeDto) throws WmsServiceException;

    /**
     * 主库存扣减
     * @param stockChangeDto
     * @return
     * @throws WmsServiceException
     */
    StockChangeDto  subMainStock(StockChangeDto stockChangeDto) throws WmsServiceException;


    /**
     * 增加拣货库存
     * @param stockChangeDto
     * @return
     * @throws WmsServiceException
     */
    StockChangeDto  addPickStock(StockChangeDto stockChangeDto) throws WmsServiceException;


    /**
     * 扣减拣货库存
     * @param stockChangeDto
     * @return
     * @throws WmsServiceException
     */
    StockChangeDto  subPickStock(StockChangeDto stockChangeDto) throws WmsServiceException;


    /**
     * 损溢操作
     * @param id
     * @param type 1：报损，2：报溢
     * @param qty
     * @param warehouseId
     * @param userId
     * @throws WmsServiceException
     */
    void increaseAndDecrease(Long id, Integer type, BigDecimal qty, String note, Long warehouseId, Integer userId) throws WmsServiceException;

    /**
     * 归还拣货库存
     * @param pickStockId
     * @param warehouseId
     * @param userId
     * @throws WmsServiceException
     */
    void back2MainStock(Long pickStockId,Long warehouseId,Integer userId) throws WmsServiceException;
}
